﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpObjects.SearchEngine.HtmlParsing.Html
{
    public abstract class HtmlContainerTag : HtmlTag
    {
        public List<HtmlTag> Children = new List<HtmlTag>();

        public HtmlContainerTag(HtmlContainerTag tag = null)
            : base(tag)
        {
            if (tag != null)
            {
                this.Children = tag.Children;
            }
        }

        public override string ToString()
        {
            string display = base.ToString();

            foreach(HtmlTag child in Children)
            {
                display += "    " + child.ToString() + "\n";    
            }

            return display;
        }

        public override bool IsContainer { get { return true; } set { } }
    }
}
